package pri.ydy.educms.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import pri.ydy.commonUtils.R;
import pri.ydy.educms.entity.CrmBanner;
import pri.ydy.educms.service.CrmBannerService;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-12-12
 */
@RestController
@RequestMapping("/educms/bannerfront")
public class BannerFrontController {

    @Autowired
    private CrmBannerService bannerService;

    //查询所有banner
    // @Cacheable(value = "banner",key = "'selectIndexList'")//redis
    //TODO 在Linux中配置Redis P177 P178
    @GetMapping("getAllBanner")
    public R getAllBanner(){
        List<CrmBanner> list= bannerService.getAllBanner();
        return R.ok().data("list",list);
    }

}

